
<h1><span class="yiyi-st" id="yiyi-16">Binary operations</span></h1>
        <blockquote>
        <p>原文：<a href="https://docs.scipy.org/doc/numpy/reference/routines.bitwise.html">https://docs.scipy.org/doc/numpy/reference/routines.bitwise.html</a></p>
        <p>译者：<a href="https://github.com/wizardforcel">飞龙</a> <a href="http://usyiyi.cn/">UsyiyiCN</a></p>
        <p>校对：（虚位以待）</p>
        </blockquote>
    
<div class="section" id="elementwise-bit-operations">
<h2><span class="yiyi-st" id="yiyi-17">Elementwise bit operations</span></h2>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%">
<col width="90%">
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><span class="yiyi-st" id="yiyi-18"><a class="reference internal" href="generated/numpy.bitwise_and.html#numpy.bitwise_and" title="numpy.bitwise_and"><code class="xref py py-obj docutils literal"><span class="pre">bitwise_and</span></code></a>（x1，x2 [，out]）</span></td>
<td><span class="yiyi-st" id="yiyi-19">计算元素方面的两个数组的逐位AND。</span></td>
</tr>
<tr class="row-even"><td><span class="yiyi-st" id="yiyi-20"><a class="reference internal" href="generated/numpy.bitwise_or.html#numpy.bitwise_or" title="numpy.bitwise_or"><code class="xref py py-obj docutils literal"><span class="pre">bitwise_or</span></code></a>（x1，x2 [，out]）</span></td>
<td><span class="yiyi-st" id="yiyi-21">计算元素方面的两个数组的逐位OR。</span></td>
</tr>
<tr class="row-odd"><td><span class="yiyi-st" id="yiyi-22"><a class="reference internal" href="generated/numpy.bitwise_xor.html#numpy.bitwise_xor" title="numpy.bitwise_xor"><code class="xref py py-obj docutils literal"><span class="pre">bitwise_xor</span></code></a>（x1，x2 [，out]）</span></td>
<td><span class="yiyi-st" id="yiyi-23">按元素方式计算两个数组的逐位异或。</span></td>
</tr>
<tr class="row-even"><td><span class="yiyi-st" id="yiyi-24"><a class="reference internal" href="generated/numpy.invert.html#numpy.invert" title="numpy.invert"><code class="xref py py-obj docutils literal"><span class="pre">invert</span></code></a>（x [，out]）</span></td>
<td><span class="yiyi-st" id="yiyi-25">逐位计算逐位反转，或逐位非单元。</span></td>
</tr>
<tr class="row-odd"><td><span class="yiyi-st" id="yiyi-26"><a class="reference internal" href="generated/numpy.left_shift.html#numpy.left_shift" title="numpy.left_shift"><code class="xref py py-obj docutils literal"><span class="pre">left_shift</span></code></a>（x1，x2 [，out]）</span></td>
<td><span class="yiyi-st" id="yiyi-27">将整数的位向左移位。</span></td>
</tr>
<tr class="row-even"><td><span class="yiyi-st" id="yiyi-28"><a class="reference internal" href="generated/numpy.right_shift.html#numpy.right_shift" title="numpy.right_shift"><code class="xref py py-obj docutils literal"><span class="pre">right_shift</span></code></a>（x1，x2 [，out]）</span></td>
<td><span class="yiyi-st" id="yiyi-29">将整数的位向右移位。</span></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="bit-packing">
<h2><span class="yiyi-st" id="yiyi-30">Bit packing</span></h2>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%">
<col width="90%">
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><span class="yiyi-st" id="yiyi-31"><a class="reference internal" href="generated/numpy.packbits.html#numpy.packbits" title="numpy.packbits"><code class="xref py py-obj docutils literal"><span class="pre">packbits</span></code></a>（myarray [，axis]）</span></td>
<td><span class="yiyi-st" id="yiyi-32">将二进制值数组的元素包含在uint8数组中的位中。</span></td>
</tr>
<tr class="row-even"><td><span class="yiyi-st" id="yiyi-33"><a class="reference internal" href="generated/numpy.unpackbits.html#numpy.unpackbits" title="numpy.unpackbits"><code class="xref py py-obj docutils literal"><span class="pre">unpackbits</span></code></a>（myarray [，axis]）</span></td>
<td><span class="yiyi-st" id="yiyi-34">将uint8数组的元素解包成二进制值输出数组。</span></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="output-formatting">
<h2><span class="yiyi-st" id="yiyi-35">Output formatting</span></h2>
<table border="1" class="longtable docutils">
<colgroup>
<col width="10%">
<col width="90%">
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td><span class="yiyi-st" id="yiyi-36"><a class="reference internal" href="generated/numpy.binary_repr.html#numpy.binary_repr" title="numpy.binary_repr"><code class="xref py py-obj docutils literal"><span class="pre">binary_repr</span></code></a>（num [，width]）</span></td>
<td><span class="yiyi-st" id="yiyi-37"></span></td>
</tr>
</tbody>
</table>
</div>
